package org.fhm.zdte.common.protocol;

/**
 * The abstract layer for a detected packet whether is valid.
 *
 * @author 谭波
 * @since 2023/11/4
 */
public abstract class AbstractMessageMonitor {

    /**
     * Whether is lawful.
     *
     * @param messageStandard Packet-Message.
     * @return <b>ture</b> means lawful, <b>false</b> means not lawful.
     */
    public abstract boolean isLawful(AbstractMessageStandard messageStandard);

    /**
     * Whether is Sub-Packet-Message.
     *
     * @param messageStandard Packet-Message.
     * @return <b>ture</b> means it is Sub-Packet-Message, <b>false</b> means it is not Sub-Packet-Message.
     */
    public abstract boolean isSubMessage(AbstractMessageStandard messageStandard);

    /**
     * Whether is Sub-Ack-Packet-Message.
     *
     * @param messageStandard Packet-Message.
     * @return <b>ture</b> means it is Sub-Ack-Packet-Message, <b>false</b> means it is not Sub-Ack-Packet-Message.
     */
    public abstract boolean isSubAckMessage(AbstractMessageStandard messageStandard);

    /**
     * Whether is Failed-Packet-Message.
     *
     * @param messageStandard Packet-Message.
     * @return <b>ture</b> means it is Failed-Packet-Message, <b>false</b> means it is not Failed-Packet-Message.
     */
    public abstract boolean isFailMessage(AbstractMessageStandard messageStandard);

    /**
     * Whether is SuccessFul-Packet-Message.
     *
     * @param messageStandard Packet-Message.
     * @return <b>ture</b> means it is SuccessFul-Packet-Message, <b>false</b> means it is not SuccessFul-Packet-Message.
     */
    public abstract boolean isSuccessful(AbstractMessageStandard messageStandard);

    /**
     * Whether is Ack-Packet-Message.
     *
     * @param messageStandard Packet-Message.
     * @return <b>ture</b> means it is Ack-Packet-Message, <b>false</b> means it is not Ack-Packet-Message.
     */
    public abstract boolean isAck(AbstractMessageStandard messageStandard);

}
